package cn.dgut.training.mapper;

import cn.dgut.training.entity.activity.Coupon;
import cn.dgut.training.entity.goods.Goods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {

    @Select({
            "<script>",
            "select * from goods",
            "where category_id in",
            "<foreach collection='categories' item='c' open='(' separator=',' close=')'>",
            "#{c}",
            "</foreach>",
            "</script>"
    })
    public List<Goods> getCategoryList(@Param("categories") long[] categories);

}
